-
Notifications
You must be signed in to change notification settings - Fork 25.5k
[ES|QL] Document return value for locate in case substring is not found #112202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Documentation preview: |
Pinging @elastic/es-docs (Team:Docs) |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please point out that the return position starts from 1 (not 0 as most programmers assume).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please point out that the return position starts from 1 (not 0 as most programmers assume).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text can be slightly rephrased to be more compact.
examples = @Example(file = "string", tag = "locate") | ||
) | ||
@FunctionInfo(returnType = "integer", description = """ | ||
Returns an integer that indicates the position of a keyword substring within another string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns an integer (starting from 1
) that indicates the position of a keyword substring within another string.
Returns 0
if the substring is not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many developers are not used with string positions starting from 1. This is why I kind of like to have that as a separate note. If you feel very strongly about I can change this again, but for now I will merge the PR as it is.
💔 Backport failed
You can use sqren/backport to manually backport by running |
…nd (elastic#112202) * Document return value for locate in case substring is not found * Add note that string positions start from 1
I wanted to use the
LOCATE
function for a test and noticed that we don't document the return value in case the substring is missing.